html input only 4 digits

62

html input only 4 digits -

<input type="text"  name="pincode" maxlength="4"  id="pin" pattern="^0[1-9]|[1-9]\d$" required/>

input digits only -

<input type="text" 
       onkeyup="this.value=this.value.replace(/[^\d]/,'')">

Comments

Submit
0 Comments